<template>
	<view class="main">
		<view class="carlist">
			<view class="list">
				<view class="car_top">
					<view class="car_top_left">
						<view class="carNum">苏D12K98</view>
						<view class="carBrand">明锐</view>
					</view>
					<view class="car_top_right">
						<view class="edit" @click="edit" :id="carId"><image src="../../static/my/edit.png" mode="widthFix"></image>编辑</view>
						<view class="delate" @click="delate"><image src="../../static/my/delate.png" mode="widthFix"></image>删除</view>
					</view>
				</view>
				<view class="car_btm">
					<!-- 设为默认 -->
					<view class="setNormal carSet" v-if="!isNormalCar" @click="setCarNormal">
						<image src="../../static/my/choose.png" mode="widthFix"></image>
						设为默认
					</view>
					<!-- 默认车辆 -->
					<view class="NormalCar carSet" v-if="isNormalCar">
						<image src="../../static/my/choosed.png" mode="widthFix"></image>
						默认车辆
					</view>
				</view>
			</view>
			
		</view>
		<view class="addCar">
			添加车辆
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isNormalCar:false
		}
	},
		// 	}
		// },
		components: {
	
		},
		onShow() {
			
			
		},
		onload() {
			
		},
		methods: {
			// 设为默认车辆
			setCarNormal() {
				if(this.isNormalCar = true) {
					return
				} else {
					this.isNormalCar = false
				}
			},
			//编辑车辆
			edit(e) {
				
			},
			//删除车辆
			delate(e) {
				
			},
			//添加车辆
			addCar(){
				uni.navigateTo({
					url:'/pages/my/addCar'
				})
			}
			
			
			
		
		},
	}
</script>

<style>
	page {
		background-color: #f2f2f4;
	}
	.main {
		padding: 20rpx 24rpx;
	}
	.carlist {
		margin-bottom: 70rpx;
	}
	.addCar {
		width: 702rpx;
		height: 84rpx;
		line-height: 84rpx;
		text-align: center;
		background: #008afd;
		border-radius: 10rpx;
		color: #fff;
		letter-spacing: 1rpx;
	}
	.list {
		width: 702rpx;
		height: 200rpx;
		background: #fff;
		border-radius: 10rpx;
		margin-bottom: 14rpx;
	}
	.edit,.delate {
		font-size: 24rpx;
		color: #999;
		letter-spacing: 2rpx;
		margin: 10rpx 0;
	}
	.edit image {
		width: 27rpx;
		height: 28rpx;
		vertical-align: sub;
		margin-right: 10rpx;
	}
	.delate image {
		width: 27rpx;
		height: 28rpx;
		vertical-align: sub;
		margin-right: 10rpx;
	}
	.car_top {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin: 0 24rpx;
		padding: 20rpx 0 10rpx;
		border-bottom: 1rpx solid #eee;
	}
	.carNum {
		font-size: 38rpx;
		color: #333;
	}
	.carBrand {
		font-size: 26rpx;
		color: #333;
	}
	.car_btm {
		padding: 0 24rpx;
		margin-top: 10rpx;
	}
	.carSet {
		font-size: 24rpx;
		color: #999;
	}
	.carSet image {
		width: 30rpx;
		height: 30rpx;
		vertical-align: sub;
		margin-right: 13rpx;
	}
	.NormalCar {
		color: #fe8734;
	}
</style>
